package com.jimmy.tx.config;

import com.jimmy.tx.service.AccountService;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @version 1.0
 * @ ClassName TxConfigTest
 * <p> TODO
 * @ author JIMMY
 * @ Date 2020/12/9 0009 下午 12:05
 */
public class TxConfigTest {
    @Test
    public void test(){
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(TxConfig.class);
        String[] beanDefinitionNames = ctx.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(beanDefinitionName);
        }
        AccountService accountService = (AccountService) ctx.getBean("accountService");
        accountService.transfer("jerry","tom",100.0);

    }
}
